import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/',
    name: 'base',
    component: ()=>import('../layout/Basic.vue'),
    children: [
      {
        path: 'home',
        component: ()=>import('../views/Home.vue'),
      },
      {
        path: '/management/user',
        component: ()=>import('../views/management/user/List.vue'), 
      },
      {
        path: '/management/role',
        component: ()=>import('../views/management/role/List.vue'), 
      },
      {
        path: '/management/power',
        component: ()=>import('../views/management/power/List.vue'), 
      },
      {
        path: '/system/menu',
        component: ()=>import('../views/system/menu/List.vue'), 
      },
    ]
  },
  {
    path: "/:pathMatch(.*)*",
    name: "404",
    component: ()=>import('../views/404.vue')
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router
